|
1 |
| -commit 54d21b7398dc1a8ff22a987c660d400347b144a9 |
| 1 | +commit 46a89fb0319d673b3139a068e3d89aed9f44fc16 |
2 | 2 | Author: Christoph Moench-Tegeder <cmt@burggraben.net>
|
3 |
| -Date: Sun Feb 11 19:11:15 2024 +0100 |
4 | 3 |
|
5 |
| - Bug 1876366: many X11 cursors stopped working |
| 4 | + use gdk legacy cursor interface by default |
6 | 5 |
|
7 |
| - revert switch to newer gdk interface, as it broke cursor shape |
8 |
| - switching and living with the default cursor only is no fun. |
9 |
| - |
10 |
| - Revert "Bug 1872961 [Linux] Use pointer cursor for hyperlinks r=emilio" |
11 |
| - |
12 |
| - This reverts commit 0574d0cdc438e4b0ce588f1652af802a0357f255. |
13 |
| - |
14 |
| - Revert "Bug 1871863 - Port from GdkCursorType to gdk_cursor_new_from_name. r=rmader,stransky" |
15 |
| - |
16 |
| - This reverts commit 5dfa42970a9577f0ac4e0992d9ec58c691e9bef6. |
| 6 | + Upstream https://bugzilla.mozilla.org/show_bug.cgi?id=1876366#c16 |
| 7 | + hints that we could re-test this once we have GTK 3.24.42 (with the |
| 8 | + now-current gtk3-3.24.41 the original problem is still reproducable, |
| 9 | + but toggling this flag does fix it for me) |
17 | 10 |
|
18 |
| -diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp |
19 |
| -index a011dcc51fdb..28100db36d89 100644 |
20 |
| ---- widget/gtk/nsWindow.cpp |
21 |
| -+++ widget/gtk/nsWindow.cpp |
22 |
| -@@ -7797,53 +7797,61 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) { |
23 |
| - |
24 |
| - GdkDisplay* defaultDisplay = gdk_display_get_default(); |
25 |
| - |
26 |
| -+ // The strategy here is to use standard GDK cursors, and, if not available, |
27 |
| -+ // load by standard name with gdk_cursor_new_from_name. |
28 |
| -+ // Spec is here: http://www.freedesktop.org/wiki/Specifications/cursor-spec/ |
29 |
| - switch (aCursor) { |
30 |
| - case eCursor_standard: |
31 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "default"); |
32 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR); |
33 |
| - break; |
34 |
| - case eCursor_wait: |
35 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "wait"); |
36 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_WATCH); |
37 |
| - break; |
38 |
| - case eCursor_select: |
39 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "text"); |
40 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_XTERM); |
41 |
| - break; |
42 |
| - case eCursor_hyperlink: |
43 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "pointer"); |
44 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_HAND2); |
45 |
| - break; |
46 |
| - case eCursor_n_resize: |
47 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "n-resize"); |
48 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_SIDE); |
49 |
| - break; |
50 |
| - case eCursor_s_resize: |
51 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "s-resize"); |
52 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_SIDE); |
53 |
| - break; |
54 |
| - case eCursor_w_resize: |
55 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "w-resize"); |
56 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_SIDE); |
57 |
| - break; |
58 |
| - case eCursor_e_resize: |
59 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "e-resize"); |
60 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_RIGHT_SIDE); |
61 |
| - break; |
62 |
| - case eCursor_nw_resize: |
63 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nw-resize"); |
64 |
| -+ gdkcursor = |
65 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_LEFT_CORNER); |
66 |
| - break; |
67 |
| - case eCursor_se_resize: |
68 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "se-resize"); |
69 |
| -+ gdkcursor = |
70 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_RIGHT_CORNER); |
71 |
| - break; |
72 |
| - case eCursor_ne_resize: |
73 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ne-resize"); |
74 |
| -+ gdkcursor = |
75 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_TOP_RIGHT_CORNER); |
76 |
| - break; |
77 |
| - case eCursor_sw_resize: |
78 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "sw-resize"); |
79 |
| -+ gdkcursor = |
80 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_BOTTOM_LEFT_CORNER); |
81 |
| - break; |
82 |
| - case eCursor_crosshair: |
83 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "crosshair"); |
84 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_CROSSHAIR); |
85 |
| - break; |
86 |
| - case eCursor_move: |
87 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "move"); |
88 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR); |
89 |
| - break; |
90 |
| - case eCursor_help: |
91 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "help"); |
92 |
| -+ gdkcursor = |
93 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_QUESTION_ARROW); |
94 |
| - break; |
95 |
| -- case eCursor_copy: |
96 |
| -+ case eCursor_copy: // CSS3 |
97 |
| - gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "copy"); |
98 |
| - if (!gdkcursor) newType = MOZ_CURSOR_COPY; |
99 |
| - break; |
100 |
| -@@ -7856,14 +7864,18 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) { |
101 |
| - if (!gdkcursor) newType = MOZ_CURSOR_CONTEXT_MENU; |
102 |
| - break; |
103 |
| - case eCursor_cell: |
104 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "cell"); |
105 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_PLUS); |
106 |
| - break; |
107 |
| -+ // Those two aren’t standardized. Trying both KDE’s and GNOME’s names |
108 |
| - case eCursor_grab: |
109 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grab"); |
110 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "openhand"); |
111 |
| - if (!gdkcursor) newType = MOZ_CURSOR_HAND_GRAB; |
112 |
| - break; |
113 |
| - case eCursor_grabbing: |
114 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grabbing"); |
115 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "closedhand"); |
116 |
| -+ if (!gdkcursor) { |
117 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "grabbing"); |
118 |
| -+ } |
119 |
| - if (!gdkcursor) newType = MOZ_CURSOR_HAND_GRABBING; |
120 |
| - break; |
121 |
| - case eCursor_spinning: |
122 |
| -@@ -7880,6 +7892,9 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) { |
123 |
| - break; |
124 |
| - case eCursor_not_allowed: |
125 |
| - gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "not-allowed"); |
126 |
| -+ if (!gdkcursor) { // nonstandard, yet common |
127 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "crossed_circle"); |
128 |
| -+ } |
129 |
| - if (!gdkcursor) newType = MOZ_CURSOR_NOT_ALLOWED; |
130 |
| - break; |
131 |
| - case eCursor_no_drop: |
132 |
| -@@ -7900,35 +7915,46 @@ static GdkCursor* get_gtk_cursor(nsCursor aCursor) { |
133 |
| - } |
134 |
| - break; |
135 |
| - case eCursor_all_scroll: |
136 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "move"); |
137 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_FLEUR); |
138 |
| - break; |
139 |
| - case eCursor_nesw_resize: |
140 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nesw-resize"); |
141 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_bdiag"); |
142 |
| - if (!gdkcursor) newType = MOZ_CURSOR_NESW_RESIZE; |
143 |
| - break; |
144 |
| - case eCursor_nwse_resize: |
145 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "nwse-resize"); |
146 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "size_fdiag"); |
147 |
| - if (!gdkcursor) newType = MOZ_CURSOR_NWSE_RESIZE; |
148 |
| - break; |
149 |
| - case eCursor_ns_resize: |
150 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ns-resize"); |
151 |
| -+ gdkcursor = |
152 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_SB_V_DOUBLE_ARROW); |
153 |
| - break; |
154 |
| - case eCursor_ew_resize: |
155 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "ew-resize"); |
156 |
| -+ gdkcursor = |
157 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_SB_H_DOUBLE_ARROW); |
158 |
| - break; |
159 |
| -+ // Here, two better fitting cursors exist in some cursor themes. Try those |
160 |
| -+ // first |
161 |
| - case eCursor_row_resize: |
162 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "row-resize"); |
163 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_v"); |
164 |
| -+ if (!gdkcursor) { |
165 |
| -+ gdkcursor = |
166 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_SB_V_DOUBLE_ARROW); |
167 |
| -+ } |
168 |
| - break; |
169 |
| - case eCursor_col_resize: |
170 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "col-resize"); |
171 |
| -+ gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "split_h"); |
172 |
| -+ if (!gdkcursor) { |
173 |
| -+ gdkcursor = |
174 |
| -+ gdk_cursor_new_for_display(defaultDisplay, GDK_SB_H_DOUBLE_ARROW); |
175 |
| -+ } |
176 |
| - break; |
177 |
| - case eCursor_none: |
178 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "none"); |
179 |
| -- if (!gdkcursor) newType = MOZ_CURSOR_NONE; |
180 |
| -+ newType = MOZ_CURSOR_NONE; |
181 |
| - break; |
182 |
| - default: |
183 |
| - NS_ASSERTION(aCursor, "Invalid cursor type"); |
184 |
| -- gdkcursor = gdk_cursor_new_from_name(defaultDisplay, "default"); |
185 |
| -+ gdkcursor = gdk_cursor_new_for_display(defaultDisplay, GDK_LEFT_PTR); |
186 |
| - break; |
187 |
| - } |
| 11 | +diff --git modules/libpref/init/StaticPrefList.yaml modules/libpref/init/StaticPrefList.yaml |
| 12 | +index 835450712a12..f2249006c36d 100644 |
| 13 | +--- modules/libpref/init/StaticPrefList.yaml |
| 14 | ++++ modules/libpref/init/StaticPrefList.yaml |
| 15 | +@@ -16070,7 +16070,7 @@ |
| 16 | + # Whether to use gtk legacy cursor API. |
| 17 | + - name: widget.gtk.legacy-cursors.enabled |
| 18 | + type: bool |
| 19 | +- value: false |
| 20 | ++ value: true |
| 21 | + mirror: always |
188 | 22 |
|
| 23 | + # Whether to use gtk high contrast themes to disable content styling like on |
0 commit comments